package com.gxa.service.investment.impl;

import com.gxa.mapper.investment.IntentionAgreementMapper;
import com.gxa.mapper.investment.IntentionRegisterMapper;
import com.gxa.mapper.investment.OccupancyRegisterMapper;
import com.gxa.mapper.investment.ProjectCloseMapper;
import com.gxa.service.investment.ProjectDetailsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.ArrayList;
import java.util.Date;
import java.util.List;

@Service
public class ProjectDetailServiceImpl implements ProjectDetailsService {
    List list = new ArrayList();
    @Autowired
    private IntentionAgreementMapper intentionAgreementMapper;
    @Autowired
    private IntentionRegisterMapper intentionRegisterMapper;
    @Autowired
    private OccupancyRegisterMapper occupancyRegisterMapper;
    @Autowired
    private ProjectCloseMapper projectCloseMapper;
    @Override
    public List<Date> queryTime(Integer id,Integer status) {
        Date date = this.intentionRegisterMapper.queryById(id);
        Date date1 = this.intentionAgreementMapper.queryByIdTime(id);
        Date date2 = this.occupancyRegisterMapper.queryByIdTime(id);
        Date date3 = this.projectCloseMapper.queryByIdTime(id);
       switch (status){
           case 0:
               list.add(date);
               break;
           case 1:
               list.add(date);
               list.add(date1);
           case 2:
               list.add(date);
               list.add(date1);
               list.add(date2);
           case 3:
               list.add(date);
               list.add(date1);
               list.add(date2);
               list.add(date3);
       }
       return list;
    }
}
